import com.bit.demo.UserService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class App2 {
    public static void main(String[] args) {
        // 1.得到 Spring 上下文对象
        BeanFactory context = new XmlBeanFactory(
                new ClassPathResource("spring-config.xml"));
        // 2.获取 Bean
        UserService userService = (UserService) context.getBean("user");
//        // 3.使用 Bean
//        userService.sayHi();
    }
}
